Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

EFM Recovery Integration Tests: Part 1 #6156

Merged
merged 67 commits into from
Jul 19, 2024

Conversation

kc1116
Copy link
Contributor

@kc1116 kc1116 commented Jun 26, 2024

This PR adds an integration test that partially tests the EFM recovery governance transaction. The intention behind this PR is to introduce a functional test suite that covers the entire process, including generating and submitting the governance transaction, making changes to the Epoch smart contract, and observing the emission of an EFM recovery service event. However, it does not test whether the emitted EFM service event is processed by the fallback state machine due to pending updates required for downstream components to deliver the service event to the fallback state machine. This approach allows us to detect any transaction argument generation or submission issues, as well as container orchestration challenges encountered while manually triggering EFM, while we continue to finalize the remaining EFM tasks.

  • Start a flow test network and manually force network into EFM
  • Generate transaction arguments for recover epoch transaction
  • Submit recover epoch transaction
  • Observe epoch recover service event

@codecov-commenter
Copy link

codecov-commenter commented Jun 26, 2024

Codecov Report

Attention: Patch coverage is 23.93162% with 178 lines in your changes missing coverage. Please review.

Project coverage is 41.67%. Comparing base (dbaa1ce) to head (1d2e034).

Files Patch % Lines
cmd/bootstrap/run/epochs.go 0.00% 100 Missing ⚠️
cmd/util/cmd/epochs/cmd/recover.go 61.90% 11 Missing and 5 partials ⚠️
integration/utils/arguments.go 0.00% 16 Missing ⚠️
integration/utils/transactions.go 0.00% 15 Missing ⚠️
utils/unittest/service_events_fixtures.go 0.00% 13 Missing ⚠️
cmd/bootstrap/utils/key_generation.go 0.00% 11 Missing ⚠️
model/convert/service_event.go 40.00% 2 Missing and 1 partial ⚠️
integration/testnet/network.go 50.00% 1 Missing and 1 partial ⚠️
utils/unittest/execution_state.go 0.00% 2 Missing ⚠️
Additional details and impacted files
@@                   Coverage Diff                    @@
##           feature/efm-recovery    #6156      +/-   ##
========================================================
- Coverage                 41.71%   41.67%   -0.04%     
========================================================
  Files                      1976     1978       +2     
  Lines                    139331   139430      +99     
========================================================
- Hits                      58120    58111       -9     
- Misses                    75155    75273     +118     
+ Partials                   6056     6046      -10     
Flag Coverage Δ
unittests 41.67% <23.93%> (-0.04%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@kc1116 kc1116 marked this pull request as ready for review June 28, 2024 00:27
@kc1116 kc1116 requested review from durkmurder, jordanschalm and AlexHentschel and removed request for zhangchiqing June 28, 2024 00:27
Copy link
Member

@jordanschalm jordanschalm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Didn't quite get through the whole PR yet. Posting what I have reviewed so far as I'll be out on Monday.

integration/tests/epochs/base_suite.go Outdated Show resolved Hide resolved
cmd/util/cmd/epochs/cmd/recover.go Outdated Show resolved Hide resolved
cmd/util/cmd/epochs/cmd/recover.go Outdated Show resolved Hide resolved
cmd/util/cmd/epochs/cmd/recover.go Outdated Show resolved Hide resolved
cmd/util/cmd/epochs/cmd/recover.go Outdated Show resolved Hide resolved
Comment on lines 37 to 39
// pausing consensus node will force the network into EFM
ln := s.GetContainersByRole(flow.RoleCollection)[0]
_ = ln.Pause()
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The comment says consensus node, but we're pausing the collection node.

In addition, I am guessing that EFM is being triggered only because we have made the DKG phases much shorter (10 views).

We should test this without pausing the collection node:

  • if we still trigger EFM, then we don't need to pause the collection node and can remove that code
  • if we don't trigger EFM, then we should revert the change to the DKG phase length

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The test did not work without pausing the collection node, we can look into it further in part 2.


sns := s.GetContainersByRole(flow.RoleConsensus)
_ = sns[0].Pause()
// get the latest snapshot and start new container with it
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

outdated comment - we aren't starting a new container

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@@ -117,8 +118,15 @@ func (s *BaseSuite) SetupTest() {
go lib.LogStatusPeriodically(s.T(), s.Ctx, s.log, s.Client, 5*time.Second)
}

func (s *BaseSuite) TearDownTest() {
s.log.Info().Msg("================> Start TearDownTest")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

still need those logs?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes these help with debugging we have them on all the epoch related integration tests.

@kc1116 kc1116 requested a review from ramtinms as a code owner July 17, 2024 21:23
@kc1116 kc1116 removed the request for review from ramtinms July 17, 2024 21:48
@kc1116 kc1116 merged commit 0a30e45 into feature/efm-recovery Jul 19, 2024
55 checks passed
@kc1116 kc1116 deleted the khalil/efm-recovery-integration-part1 branch July 19, 2024 15:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants